package com.sali.commons.disruptor;

import com.lmax.disruptor.ExceptionHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DataProcessExceptionHandler implements ExceptionHandler<DataProcessEvent> {

    public static final Logger log = LoggerFactory.getLogger(ExceptionHandler.class);

    @Override
    public void handleEventException(Throwable throwable, long l, DataProcessEvent dataProcessEvent) {
        log.error("[data-processor] 处理数据过程中产生异常：{}. data: {}", throwable.getMessage(), dataProcessEvent.getVal());
        throwable.printStackTrace();
    }

    @Override
    public void handleOnStartException(Throwable throwable) {

    }

    @Override
    public void handleOnShutdownException(Throwable throwable) {

    }


}
